package com.example.controller;

import java.util.Arrays;
import java.util.List;

import com.example.pojo.CusDevPlan;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.example.vo.ResultVo;
import com.github.pagehelper.PageInfo;
import com.example.pojo.CustomerOrder;
import com.example.service.ICustomerOrderService;
import io.swagger.annotations.Api;
/**
 * <p>
 * 客户订单表 前端控制器
 * </p>
 *
 * @author wsl
 * @since 2022-04-28
 */
@RestController
@RequestMapping("/customerOrder")
@Api(tags = "客户订单表",value = "")
@CrossOrigin(allowCredentials = "true")
public class CustomerOrderController {
    @Autowired
    private ICustomerOrderService customerOrderService;

    /**
     * 分页
     */
    @GetMapping("/pager")
    @ApiOperation(value = "获得客户开发计划分页信息")
    public PageInfo<CustomerOrder> displayPager(@RequestParam(defaultValue = "1")Integer pageNum,
                                             @RequestParam(defaultValue = "5")Integer pageSize){
        return customerOrderService.electByPager(pageNum,pageSize);
    }

    /**
     * 查询所有
     */
    @GetMapping("")
    public List<CustomerOrder> displayCustomerOrderInfo(){
        return customerOrderService.selectAll();
    }
}
